package com.huike.controller.system;

import java.util.Iterator;
import java.util.List;

import com.huike.domain.common.TreeSelect;
import com.huike.web.CurrentUserHolder;
import com.huike.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.huike.common.annotation.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.huike.service.ISysDeptService;
import com.huike.common.annotation.Log;
import com.huike.common.constant.UserConstants;
import com.huike.controller.core.BaseController;
import com.huike.domain.common.AjaxResult;
import com.huike.domain.system.SysDept;
import com.huike.common.enums.BusinessType;

/**
 * 部门信息
 */
@Api(tags = "部门管理")
@RestController
@RequestMapping("/system/dept")
public class SysDeptController extends BaseController {

    @Autowired
    private ISysDeptService deptService;

    /**
     * 获取部门列表
     */
    @ApiOperation("部门管理-列表查询")
    @PreAuthorize("system:dept:list")
    //@GetMapping("/list")
    public AjaxResult list(SysDept dept) {

        return null;
    }

    /**
     * 查询部门列表（排除节点）
     */
    @ApiOperation("部门管理-查询部门列表（排除节点）")
    @PreAuthorize("system:dept:list")
    //@GetMapping("/list/exclude/{deptId}")
    public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId){
        return null;
    }

    /**
     * 根据部门编号获取详细信息
     */
    @ApiOperation("部门管理-详情查询")
    @PreAuthorize("system:dept:query")
    //@GetMapping(value = "/{deptId}")
    public AjaxResult getInfo(@PathVariable Long deptId) {
        return null;
    }

    /**
     * 获取部门下拉树列表
     */
    @ApiOperation("部门管理-获取部门下拉树列表")
    //@GetMapping("/treeselect")
    public AjaxResult treeselect(SysDept dept) {
        return null;
    }

    /**
     * 加载对应角色部门列表树
     */
    @ApiOperation("部门管理-获取对应角色部门树")
    //@GetMapping(value = "/roleDeptTreeselect/{roleId}")
    public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId) {
        return null;
    }

    /**
     * 新增部门
     */
    @ApiOperation("部门管理-新增")
    @PreAuthorize("system:dept:add")
    @Log(title = "部门管理", businessType = BusinessType.INSERT)
    //@PostMapping
    public AjaxResult add(@Validated @RequestBody SysDept dept) {
        return null;
    }

    /**
     * 修改部门
     */
    @ApiOperation("部门管理-修改")
    @PreAuthorize("system:dept:edit")
    @Log(title = "部门管理", businessType = BusinessType.UPDATE)
    //@PutMapping
    public AjaxResult edit(@Validated @RequestBody SysDept dept) {
        return null;
    }

    /**
     * 删除部门
     */
    @ApiOperation("部门管理-删除")
    @PreAuthorize("system:dept:remove")
    @Log(title = "部门管理", businessType = BusinessType.DELETE)
    //@DeleteMapping("/{deptId}")
    public AjaxResult remove(@PathVariable Long deptId) {
        return null;
    }


    @ApiOperation("部门管理-获取部门人员")
    //@GetMapping("/treeAnduser")
    public AjaxResult treeAnduser() {
        return null;
    }
}
